<template>
  <div class="page">
    <div class="login-header-outer">
      <div class="contant login-header">
        <!-- <div class="header-title">
          <div class="title-end">
            智慧管理平台
            <i>Management</i>
          </div>
        </div>-->
        <div class="header-link">
          <i class="el-icon-phone-outline"></i>联系方式
          <i>0791-876066606</i>
        </div>
      </div>
    </div>

    <div class="window-center">
      <div class="spinner">
        <div class="rect1"></div>
        <div class="rect2"></div>
        <div class="rect3"></div>
        <div class="rect4"></div>
        <div class="rect5"></div>
      </div>
      <div class="spinner-tip">
        登录中，请稍后
        <span class="dot"></span>
      </div>
      <div style="color: #666; line-height: 30px">登录不成功？ <a-button @click="backpre" type="link">返回登录</a-button></div>
    </div>

    <div class="copyright">
      <span>版权所有：洪图公司 </span>
    </div>
  </div>
</template>
   
<script>
	
import {defineComponent,onMounted} from 'vue'
import {useRouter} from 'vue-router'
import {assetapisystemusergetCurrentUser,
assetapisystemusergetUserInfo
} from '../../../api/manpart.js'
export default defineComponent({
	setup(){
		const $route=useRouter()
		let token=$route.currentRoute.value.query.token
		let platformNo=$route.currentRoute.value.query.platformNo
		console.log(token)
		localStorage.setItem('ht-new-fixed-token',token)
		onMounted(()=>{
			getUser(token)
			//getToken(token)
		})
		
		const getToken=(token)=>{
			
			assetapisystemusergetUserInfo({token}).then(e=>{
				console.log(e)
			})
		}
		
		
		const getUser=()=>{
			assetapisystemusergetCurrentUser({token}).then(e=>{
				if(e.code==5){
					return
				}
				globalVar.Message.success('登录成功')
				
				localStorage.setItem('menuList',JSON.stringify(e.object.menuButtonTree))
				
				// officeName:userInfo.officeName,
				// username:userInfo.username
				
				e.object.username=e.object.userName
				e.object.userCode=e.object.userNo
				e.object.token=token
				e.object.role=e.object.roleList.join(',')
				
				if(e.object.deptList&&e.object.deptList.length){
					e.object.officeName=e.object.deptList[0].deptName
					e.object.officeNo=e.object.deptList[0].deptNo
				}
				e.object.platformNo=platformNo
				localStorage.setItem('ht-new-fixed-user',JSON.stringify(e.object))
				
				
				$route.push({
					path:'/home'
				})
			}).catch(err=>{
				console.log(err)
			})
		}
		
		const backpre=()=>{
			window.history.go(-1)
		}
		let url="http://120.203.64.203:8686/assetSystem/#/home"
		return{
			
			backpre,
			
		}
	}
})



// export default {
//   data: function () {
//     return {
//       switchpath: '',
//       token: this.$route.query.token,
     
//       loginPageUrl: 'http://120.203.64.203:8686/assetSystem/#/home'
//     };
//   },
//   methods: {
   
 
// 	backpre(){
// 		window.history.go(-1)
// 	},
   
//     login() {
		
     
// 		this.getdata();
//     }
//   },
//   mounted() {
//     this.switchpath = this.$route.query.path ? this.$route.query.path : '/home';
//     this.login();
//   }
// };
</script>


<style scoped>
.page {
  box-sizing: border-box;
  height: 100%;
  min-height: 100%;
  background-color: #ebebeb;
  padding-bottom: 30px;
}

.contant {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

.login-header-outer {
  position: absolute;
  width: 100%;
  top: 0;
  left: 0;
  z-index: 2;
  background-color: #ebebeb;
}

.login-header {
  color: #272727;
  line-height: 80px;
}
.header-title {
  font-size: 26px;
  font-weight: 600;
}
.title-end {
  font-size: 16px;
  font-weight: 100;
  position: relative;
  display: inline-block;
  line-height: 14px;
  /* margin-left: 4px; */
  top: 6px;
  left: 6px;
  color: #236291;
}
.title-end i {
  font-size: 10px;
  display: block;
  letter-spacing: 2.4px;
}

.logo {
  width: 380px;
  vertical-align: middle;
}

.header-link {
  display: inline-block;
  text-align: right;
  position: absolute;
  right: 0;
  top: 0;
  font-size: 14px;
  line-height: 15px;
  margin-top: 28px;
}
.header-link .el-icon-phone-outline {
  display: inline;
  margin-right: 4px;
  vertical-align: middle;
  color: #21629e;
  font-weight: 600;
  font-size: 14px;
}
.header-link i {
  font-size: 12px;
  display: block;
  letter-spacing: 0.6px;
  font-weight: 100;
}

.m-10 {
  margin-top: 10px;
}

.copyright {
  position: fixed;
  bottom: 0;
  left: 0;
  color: #a8a9ab;
  background-color: #313131;
  line-height: 30px;
  width: 100%;
  font-size: 12px;
  text-align: center;
}
.copyright span {
  margin: 0 20px;
}

.iconfont {
  font-size: 36px;
  color: #666;
  transition: all 0.2s;
}

.icon-text {
  font-size: 12px;
  color: #666;
  transition: all 0.2s;
}

.active {
  background-color: #6791e7;
}
.active .iconfont,
.active .icon-text {
  color: #fff;
}

.icon-box {
  /* padding: 10px 0; */
  cursor: pointer;
}
.div100 {
  width: 100%;
  height: 100%;
  padding: 10px 0;
}

.main-bg {
  width: 640px;
}

.bg-pos {
  position: absolute;
  left: 0;
  margin-top: 0;
  width: 100%;
}

.bg1 {
  margin-top: 50px;
  margin-left: 10px;
}

.bg2 {
  width: 600px;
  margin-top: 40px;
  margin-left: 40px;
}
.bg3 {
  width: 620px;
  margin-top: 34px;
  margin-left: 40px;
}
.bg4 {
  width: 580px;
  margin-top: 30px;
  margin-left: 30px;
}
.main-bg-s {
  position: absolute;
  width: 800px;
  bottom: 0;
}

.switch-title {
  font-size: 40px;
  text-align: center;
  margin-bottom: 30px;
}

.switch-img-box {
  width: 100%;
  height: 300px;
  /* background-image: linear-gradient(#1537a2, #2958d4, #1537a2); */
  background-color: #fff;
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  margin-top: 30px;
}

.switch-img-box:hover .swicth-img {
  width: 84%;
}

.swicth-img {
  width: 80%;
  margin: 0 auto;
  margin-top: 34px;
  display: block;
  transition: all 0.4s;
}

.swicth-text {
  position: absolute;
  bottom: 0;
  left: 0;
  line-height: 80px;
  font-size: 24px;
  text-align: center;
  color: #2a2a2a;
  width: 100%;
}

.mark {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.25);
}

.mg-top {
  margin-top: 40px;
}

.spinner {
  margin: 40px auto;
  width: 50px;
  height: 80px;
  text-align: center;
  font-size: 10px;
}

.spinner > div {
  background-color: #173aa6;
  height: 100%;
  width: 6px;
  display: inline-block;

  -webkit-animation: stretchdelay 1.2s infinite ease-in-out;
  animation: stretchdelay 1.2s infinite ease-in-out;
}

.spinner .rect2 {
  -webkit-animation-delay: -1.1s;
  animation-delay: -1.1s;
}

.spinner .rect3 {
  -webkit-animation-delay: -1s;
  animation-delay: -1s;
}

.spinner .rect4 {
  -webkit-animation-delay: -0.9s;
  animation-delay: -0.9s;
}

.spinner .rect5 {
  -webkit-animation-delay: -0.8s;
  animation-delay: -0.8s;
}

@-webkit-keyframes stretchdelay {
  0%,
  40%,
  100% {
    -webkit-transform: scaleY(0.4);
  }
  20% {
    -webkit-transform: scaleY(1);
  }
}

@keyframes stretchdelay {
  0%,
  40%,
  100% {
    transform: scaleY(0.4);
    -webkit-transform: scaleY(0.4);
  }
  20% {
    transform: scaleY(1);
    -webkit-transform: scaleY(1);
  }
}

.window-center {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.spinner-tip {
  font-size: 30px;
  color: #666;
}

.dot {
  display: inline-block;
  height: 1em;
  line-height: 1;
  text-align: left;
  vertical-align: -0.25ex;
  overflow: hidden;
}
.dot::before {
  display: block;
  content: '...\A..\A.';
  white-space: pre-wrap;
  animation: dot1 3s infinite step-start both;
}
@keyframes dot1 {
  33% {
    transform: translateY(-2em);
  }
  66% {
    transform: translateY(-1em);
  }
}
</style>